﻿using System;
using System.Windows;
using SnakeGame.ViewModels;

namespace SnakeGame.Views
{
    /// <summary>
    /// Interaction logic for MessageWindow.xaml
    /// </summary>
    public partial class MessageWindow : Window
    {
        private MessageWindowViewModel _msgViewModel;
        public MessageWindow()
        {
            InitializeComponent();
        }

        public void Initialize(string message)
        {
            _msgViewModel = new MessageWindowViewModel();
            _msgViewModel.RequestClose += _msgViewModel_RequestClose;
            DataContext = _msgViewModel;
            _msgViewModel.Initialize(message);
        }

        void _msgViewModel_RequestClose(object sender, EventArgs e)
        {
            Close();
        }
    }
}
